/**
  @file     	DESIGNPATTERN_Builder.h 
  @brief    	1.When the algorithm to create complex object should be independent of the part of the object, 
                  as well as their assembly;
				2.When construction process must be allowed to construct the object is different;
  @author  	arvin
  @version 	1.0   2012/12/20
 */

#include "stdafx.h"

#ifndef CXX_DESIGNPATTERN_BUILDER_H
#include "DESIGNPATTERN_Builder.h"
#endif

#ifndef CXX_DESIGNPATTERN_ABSTRACTFACTORY_H
#include "DESIGNPATTERN_AbstractFactory.h"
#endif

#ifndef CXX_COMPUTER_H
#include "Computer.h"
#endif

#ifndef CXX_MOUSE_H
#include "Mouse.h"
#endif

#ifndef CXX_KEYBOARD_H
#include "Keyboard.h"
#endif

#ifndef CXX_MONITOR_H
#include "Monitor.h"
#endif

#ifndef CXX_HOST_H
#include "Host.h"
#endif


/**
* Construction
*
* @param MANUFACTURER_TYPE eManufacturer
* @return 
*/
Builder::Builder(MANUFACTURER_TYPE eManufacturer) :
	m_eManufacturer(eManufacturer)
{
	DEBUG_PRINTF("m_eManufacturer[%d], Manufacturer[%s]", m_eManufacturer, STATIC_CONST_STRING_MANUFACTURER[m_eManufacturer].c_str());
}

/**
* Destruction
*
* @param VOID
* @return 
*/
Builder::~Builder()
{
	DEBUG_PRINTF("m_eManufacturer[%d], Manufacturer[%s]", m_eManufacturer, STATIC_CONST_STRING_MANUFACTURER[m_eManufacturer].c_str());
}

/**
* Build Mouse
*
* @param VOID
* @return Mouse*
* @note build and process product
*/
Mouse* 
Builder::BuildMouse()
{
	//system error log
	DEBUG_PRINTF("m_eManufacturer[%d], Manufacturer[%s]", m_eManufacturer, STATIC_CONST_STRING_MANUFACTURER[m_eManufacturer].c_str());
	return NULL;
}

/**
* Build Keyboard
*
* @param VOID
* @return Keyboard*
* @note build and process product
*/
Keyboard* 
Builder::BuildKeyboard()
{
	//system error log
	DEBUG_PRINTF("m_eManufacturer[%d], Manufacturer[%s]", m_eManufacturer, STATIC_CONST_STRING_MANUFACTURER[m_eManufacturer].c_str());
	return NULL;
}
/**
* Build Monitor
*
* @param VOID
* @return Monitor*
* @note build and process product
*/
Monitor* 
Builder::BuildMonitor()
{
	//system error log
	DEBUG_PRINTF("m_eManufacturer[%d], Manufacturer[%s]", m_eManufacturer, STATIC_CONST_STRING_MANUFACTURER[m_eManufacturer].c_str());
	return NULL;
}

/**
* Build Host
*
* @param VOID
* @return Host*
* @note build and process product
*/
Host* 
Builder::BuildHost()
{
	//system error log
	DEBUG_PRINTF("m_eManufacturer[%d], Manufacturer[%s]", m_eManufacturer, STATIC_CONST_STRING_MANUFACTURER[m_eManufacturer].c_str());
	return NULL;
}

/**
* SetManufacturer
*
* @param MANUFACTURER_TYPE eManufacturer
* @return
*/
VOID
Builder::SetManufacturer(MANUFACTURER_TYPE eManufacturer)
{
	DEBUG_PRINTF("m_eManufacturer[%d], Manufacturer[%s]", m_eManufacturer, STATIC_CONST_STRING_MANUFACTURER[m_eManufacturer].c_str());
	m_eManufacturer = eManufacturer;
}

/**
* GetManufacturer
*
* @param VOID
* @return MANUFACTURER_TYPE
*/
MANUFACTURER_TYPE
Builder::GetManufacturer()
{
	DEBUG_PRINTF("m_eManufacturer[%d], Manufacturer[%s]", m_eManufacturer, STATIC_CONST_STRING_MANUFACTURER[m_eManufacturer].c_str());
	return m_eManufacturer;
}

DELLBuilder* DELLBuilder::m_pInstance = NULL;

/**
* Construction
*
* @param VOID
* @return 
*/
DELLBuilder::DELLBuilder() :
	Builder(MANUFACTURER_DELL)
{
	DEBUG_PRINTF("");
}

/**
* Destruction
*
* @param VOID
* @return 
*/
DELLBuilder::~DELLBuilder()
{
	DEBUG_PRINTF("");
}

/**
* Instance
*
* @param VOID
* @return DELLBuilder*
* @note singleton
*/
DELLBuilder* 
DELLBuilder::Instance()
{
	DEBUG_PRINTF("");
	if (NULL == m_pInstance) {
		m_pInstance = new DELLBuilder;
	}
	return m_pInstance;
}


/**
* Destroy
*
* @param VOID
* @return VOID
* @note singleton
*/
VOID 
DELLBuilder::Destroy()
{
	DEBUG_PRINTF("");
	if (NULL != m_pInstance) {
		delete m_pInstance;
		m_pInstance = NULL;
	}
}

/**
* Build Mouse
*
* @param VOID
* @return Mouse*
* @note build and process product
*/
Mouse* 
DELLBuilder::BuildMouse()
{
	DEBUG_PRINTF("");
	return new DELLMouse;
}

/**
* Build Keyboard
*
* @param VOID
* @return Keyboard*
* @note build and process product
*/
Keyboard* 
DELLBuilder::BuildKeyboard()
{
	DEBUG_PRINTF("");
	return new DELLKeyboard;
}

/**
* Build Monitor
*
* @param VOID
* @return Monitor*
* @note build and process product
*/
Monitor* 
DELLBuilder::BuildMonitor()
{
	DEBUG_PRINTF("");
	return new DELLMonitor;
}

/**
* Build Host
*
* @param VOID
* @return Host*
* @note build and process product
*/
Host* 
DELLBuilder::BuildHost()
{
	DEBUG_PRINTF("");
	return new DELLHost;
}


ASUSBuilder* ASUSBuilder::m_pInstance = NULL;

/**
* Construction
*
* @param VOID
* @return 
*/
ASUSBuilder::ASUSBuilder() :
	Builder(MANUFACTURER_ASUS)
{
	DEBUG_PRINTF("");
}

/**
* Destruction
*
* @param VOID
* @return 
*/
ASUSBuilder::~ASUSBuilder()
{
	DEBUG_PRINTF("");
}

/**
* Instance
*
* @param VOID
* @return ASUSBuilder*
* @note singleton
*/
ASUSBuilder* 
ASUSBuilder::Instance()
{
	DEBUG_PRINTF("");
	if (NULL == m_pInstance) {
		m_pInstance = new ASUSBuilder;
	}
	return m_pInstance;
}


/**
* Destroy
*
* @param VOID
* @return VOID
* @note singleton
*/
VOID 
ASUSBuilder::Destroy()
{
	DEBUG_PRINTF("");
	if (NULL != m_pInstance) {
		delete m_pInstance;
		m_pInstance = NULL;
	}
}

/**
* Build Mouse
*
* @param VOID
* @return Mouse*
* @note build and process product
*/
Mouse* 
ASUSBuilder::BuildMouse()
{
	DEBUG_PRINTF("");
	return new ASUSMouse;
}

/**
* Build Keyboard
*
* @param VOID
* @return Keyboard*
* @note build and process product
*/
Keyboard* 
ASUSBuilder::BuildKeyboard()
{
	DEBUG_PRINTF("");
	return new ASUSKeyboard;
}

/**
* Build Monitor
*
* @param VOID
* @return Monitor*
* @note build and process product
*/
Monitor* 
ASUSBuilder::BuildMonitor()
{
	DEBUG_PRINTF("");
	return new ASUSMonitor;
}

/**
* Build Host
*
* @param VOID
* @return Host*
* @note build and process product
*/
Host* 
ASUSBuilder::BuildHost()
{
	DEBUG_PRINTF("");
	return new ASUSHost;
}



HPBuilder* HPBuilder::m_pInstance = NULL;

/**
* Construction
*
* @param VOID
* @return 
*/
HPBuilder::HPBuilder() :
	Builder(MANUFACTURER_HP)
{
	DEBUG_PRINTF("");
}

/**
* Destruction
*
* @param VOID
* @return 
*/
HPBuilder::~HPBuilder()
{
	DEBUG_PRINTF("");
}

/**
* Instance
*
* @param VOID
* @return HPBuilder*
* @note singleton
*/
HPBuilder* 
HPBuilder::Instance()
{
	DEBUG_PRINTF("");
	if (NULL == m_pInstance) {
		m_pInstance = new HPBuilder;
	}
	return m_pInstance;
}


/**
* Destroy
*
* @param VOID
* @return VOID
* @note singleton
*/
VOID 
HPBuilder::Destroy()
{
	DEBUG_PRINTF("");
	if (NULL != m_pInstance) {
		delete m_pInstance;
		m_pInstance = NULL;
	}
}

/**
* Build Mouse
*
* @param VOID
* @return Mouse*
* @note build and process product
*/
Mouse* 
HPBuilder::BuildMouse()
{
	DEBUG_PRINTF("");
	return new HPMouse;
}

/**
* Build Keyboard
*
* @param VOID
* @return Keyboard*
* @note build and process product
*/
Keyboard* 
HPBuilder::BuildKeyboard()
{
	DEBUG_PRINTF("");
	return new HPKeyboard;
}

/**
* Build Monitor
*
* @param VOID
* @return Monitor*
* @note build and process product
*/
Monitor* 
HPBuilder::BuildMonitor()
{
	DEBUG_PRINTF("");
	return new HPMonitor;
}

/**
* Build Host
*
* @param VOID
* @return Host*
* @note build and process product
*/
Host* 
HPBuilder::BuildHost()
{
	DEBUG_PRINTF("");
	return new HPHost;
}
/* EOF */